Skip to content

fix(prover-node): report awaiting-root and publishing-proof phases in EpochSession (A-1212)#24216

Merged
PhilWindle merged 3 commits into
merge-train/spartan-v5from
phil/a-1212-epochsession-reports-awaiting-checkpoints-while-proving-and
Jun 22, 2026
Merged

fix(prover-node): report awaiting-root and publishing-proof phases in EpochSession (A-1212)#24216
PhilWindle merged 3 commits into
merge-train/spartan-v5from
phil/a-1212-epochsession-reports-awaiting-checkpoints-while-proving-and

Conversation

@PhilWindle

Copy link
Copy Markdown
Collaborator

Fixes A-1212.

Problem

prover_getJobs exposes each EpochSession's state, but EpochSession only ever assigned initialized, awaiting-checkpoints, and the terminal states. The intermediate phases that exist to describe active work were never set, so a session read awaiting-checkpoints continuously while it was actually (a) proving the top tree or (b) publishing to L1. Observed on staging-internal: every startProof session sat in awaiting-checkpoints even with logs showing Starting top-tree prove…. This is a regression vs the old EpochProvingJob, which advanced through distinct phases.

Fix

  • Add a new non-terminal awaiting-root state to EpochProvingJobState (the zod schema is derived from the same array, so it updates automatically). Not added to EpochProvingJobTerminalState.
  • Set awaiting-root when the top-tree (root) prove begins, via the TopTreeJob beforeProve hook — which fires once the sub-tree (checkpoint block) proofs are ready and the root prove is about to start. toTopTreeHooks() now always wires this transition and layers any test-provided hooks on top (previously it returned undefined when no test hooks were set).
  • Set publishing-proof at the top of submitProof(), before the L1 submit.

Both transitions are guarded by isTerminal() so a concurrent cancel() still wins (the post-submit isTerminal() check relies on this).

Phase progression is now: initialized → awaiting-checkpoints → awaiting-root → publishing-proof → terminal.

Tests

  • epoch-session.test.ts: new "state reporting" test asserts getState() is awaiting-root during the prove and publishing-proof during the submit, then completed. Existing hook-ordering test (before/prove/after) still holds.
  • prover-node.test.ts: the JSON-RPC schema round-trip mock now includes an awaiting-root job.

Targets the v5 line — the EpochSession/TopTreeJob/awaiting-checkpoints code (post-#23552) exists only on merge-train/spartan-v5.

… EpochSession (A-1212)

EpochSession only ever set initialized, awaiting-checkpoints and terminal
states, so prover_getJobs showed a session as awaiting-checkpoints
continuously while it was actually proving the top tree or publishing to
L1 — a regression vs the old EpochProvingJob, which advanced through
distinct phases.

- Add a new non-terminal awaiting-root state to EpochProvingJobState.
- Set awaiting-root when the top-tree (root) prove begins, via the
  TopTreeJob beforeProve hook (fires once the sub-tree block proofs are
  ready). toTopTreeHooks now always wires this, layering any
  test-provided hooks on top.
- Set publishing-proof at the top of submitProof, before the L1 submit.

Both transitions are guarded by isTerminal() so a concurrent cancel()
still wins. Phase progression is now
initialized -> awaiting-checkpoints -> awaiting-root -> publishing-proof
-> terminal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PhilWindle PhilWindle added the ci-draft Run CI on draft PRs. label Jun 20, 2026
…chSession lifecycle (A-1212)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PhilWindle PhilWindle marked this pull request as ready for review June 22, 2026 08:48
@PhilWindle PhilWindle removed the ci-draft Run CI on draft PRs. label Jun 22, 2026
…eports-awaiting-checkpoints-while-proving-and
@PhilWindle PhilWindle enabled auto-merge (squash) June 22, 2026 15:22
@PhilWindle PhilWindle merged commit eb7d64d into merge-train/spartan-v5 Jun 22, 2026
12 checks passed
@PhilWindle PhilWindle deleted the phil/a-1212-epochsession-reports-awaiting-checkpoints-while-proving-and branch June 22, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants